package com.itheima.entity;

public class Result<T> {
    private boolean flag;
    private T data;
    private String errorMsg;

    /**
     * 失败时走这个构造创建
     * @param flag
     * @param errorMsg
     */
    public Result(boolean flag, String errorMsg) {
        this.flag = flag;
        this.errorMsg = errorMsg;
    }
    /**
     * 成功时走这个构造创建
     * @param flag
     * @param data
     */
    public Result(boolean flag, T data) {
        this.flag = flag;
        this.data = data;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
